home *** CD-ROM | disk | FTP | other *** search
-
-
-
- Tcl_TildeSubst C Library Procedures Tcl_TildeSubst
-
-
-
- _________________________________________________________________
-
- NNAAMMEE
- Tcl_TildeSubst - replace tilde with home directory in a file
- name
-
- SSYYNNOOPPSSIISS
- ##iinncclluuddee <<ttccll..hh>>
-
- char *
- TTccll__TTiillddeeSSuubbsstt(_i_n_t_e_r_p, _n_a_m_e)
-
- AARRGGUUMMEENNTTSS
- Tcl_Interp *_i_n_t_e_r_p (in) Interpreter in which to
- report an error, if any.
-
- char *_n_a_m_e (in) File name, which may start
- with a ``~''.
- _________________________________________________________________
-
-
- DDEESSCCRRIIPPTTIIOONN
- This utility procedure does tilde substition. If _n_a_m_e
- doesn't start with a ``~'' character, then the procedure
- returns _n_a_m_e. If _n_a_m_e does start with a tilde, then
- TTccll__TTiillddeeSSuubbsstt returns a new string identical to _n_a_m_e except
- that the first element of _n_a_m_e is replaced with the location
- of the home directory for the given user. The substitution
- is carried out in the same way that it would be done by _c_s_h.
- If the tilde is followed immediately by a slash, then the
- $$HHOOMMEE environment variable is substituted. Otherwise the
- characters between the tilde and the next slash are taken as
- a user name, which is looked up in the password file; the
- user's home directory is retrieved from the password file
- and substituted.
-
- The string returned by TTccll__TTiillddeeSSuubbsstt is a static string
- belonging to TTccll__TTiillddeeSSuubbsstt. Its value will only persist
- until the next call to TTccll__TTiillddeeSSuubbsstt; the caller should
- make a copy of the result if it needs to live a long time.
-
- If an error occurs (e.g. because there was no user by the
- given name) then NULL is returned and an error message will
- be left at _i_n_t_e_r_p->_r_e_s_u_l_t. It is assumed that _i_n_t_e_r_p-
- >_r_e_s_u_l_t has been initialized in the standard way when
- TTccll__TTiillddeeSSuubbsstt is invoked.
-
-
- KKEEYYWWOORRDDSS
- file name, home directory, tilde, user
-
-
-
-
-
- Sprite v1.0 1
-
-
-
-